<me:UIWBBST x:Class="WPFExcelReport.TWBQI03"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                     xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT" 
                    xmlns:WS="clr-namespace:WPFExcelReport;assembly=TWASTAMM" 
                    xmlns:BW="clr-namespace:WPFExcelReport;assembly=TWBBEW" 
                    xmlns:WB="clr-namespace:WPFExcelReport;assembly=TWBDAT" 
                    xmlns:DR="clr-namespace:WPFExcelReport;assembly=TDRAUFTR" 
                     xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"  
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                    xmlns:ER="clr-namespace:WPFExcelReport;assembly=TWBFEHL"
                    xmlns:FK="clr-namespace:WPFExcelReport;assembly=TWBFKOPF"
                    xmlns:HR="clr-namespace:WPFExcelReport;assembly=THRSTAMM" 
                    xmlns:HRC="clr-namespace:WPFExcelReport;assembly=TICC_HRSTAMM" 
                    IsPage="False"
                    Rows="30"
                    FTAUTOSUM="True"
                    SKEY1="WBBMANDANT" 
                    KEY1="WBBSSTKLG"      
                    x:Name="TV" 
                    Loaded="Window_Loaded"
     >
    <me:UIWBBST.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>
        <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:NOTConverter  x:Key="not"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <ucd:KM2YD x:Key="KM2YD"/>
        <ucd:NOTBoolToVisibilityConverter x:Key="nbv"/>
        <ucd:M2YD x:Key="M2YD"/>
        <ucd:SubStrConverter x:Key="substr"/>
    </me:UIWBBST.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="1*"></RowDefinition> 
        </Grid.RowDefinitions>
        <HRC:TLOGIN  
                    Name="cLogIn"
                    Visibility="{Binding IsLogOn,ElementName=TV,Converter={StaticResource ResourceKey=nbv}}"  
                    IsLogOn="{Binding IsLogOn,ElementName=TV}"/>
        <Grid Visibility="{Binding IsLogOn,ElementName=TV,Converter={StaticResource ResourceKey=bv}}">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="1*"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="1*"/>
                <ColumnDefinition Width="220"/>
            </Grid.ColumnDefinitions>

            <Expander Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" MaxHeight="500"
                      Name="cWBLIST"
                       Header="{Binding Source={Localization:Translate Word=清单}}" ExpandDirection="Down" IsExpanded="False">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"></RowDefinition>
                        <RowDefinition Height="1*" MaxHeight="600"></RowDefinition>
                        <RowDefinition Height="Auto"></RowDefinition>
                    </Grid.RowDefinitions>
                    <DataGrid  Grid.Row="1" 
                   VerticalAlignment="Top"   
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   IsReadOnly="True"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                   HeadersVisibility="Column"     
                   ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster}}" 
                   IsSynchronizedWithCurrentItem="True" 
                   FontSize="16"
                   x:Name="dlgMaster"  
                   RowDetailsVisibilityMode="Visible"  Margin="0,0,0,0"
                    >
                        <DataGrid.Columns>
                            <DataGridTextColumn   Header="{Binding Source={Localization:Translate Word=织机}}" Binding="{Binding LOOMID}"/>
                            <DataGridTextColumn  Header="{Binding Source={Localization:Translate Word=检验 }}" Binding="{Binding WBEWBUCHUHR}"/>
                            <DataGridTextColumn  Header="{Binding Source={Localization:Translate Word=落布 }}" Binding="{Binding PBLENGTH,Converter={StaticResource ResourceKey=d1000}}"/>
                            <DataGridTextColumn   Header="{Binding Source={Localization:Translate Word=条码号}}" Binding="{Binding WBBSTKNR,Converter={StaticResource substr},ConverterParameter=8+4}"/>
                            <DataGridTextColumn  Header="{Binding Source={Localization:Translate Word=码表长 }}" Binding="{Binding WBBISTKLG,Converter={StaticResource ResourceKey=d1000}}" Foreground="Red" />
                            <DataGridTextColumn  Header="{Binding Source={Localization:Translate Word=标签长}}" Binding="{Binding WBBSSTKLG,Converter={StaticResource ResourceKey=d1000}}"/>
                            <DataGridTextColumn  IsReadOnly="True"  Binding="{Binding Path=WBBZENSURKZ}" Header="{Binding Source={Localization:Translate Word=等}}"  Width="Auto"/>
                            <DataGridTextColumn  Header="织物名称" Binding="{Binding WBBFILLER,Converter={StaticResource gb2312}}"/>
                            <DataGridTextColumn  Header="织物" Binding="{Binding WBBART,Converter={StaticResource gb2312}}"/>
                            <DataGridTextColumn  Header="批号" Binding="{Binding WBBDPART,Converter={StaticResource gb2312}}"/>
                            <DataGridTextColumn Binding="{Binding Path=WBBBEM,Converter={StaticResource gb2312}}" Visibility="Collapsed" Header="{Binding Source={Localization:Translate Word=备注}}"  Width="Auto" />
                        </DataGrid.Columns>
                    </DataGrid  >
                    <WrapPanel Grid.Row="2">
                        <TextBlock Text="{Binding Source={Localization:Translate Word=总数量:}}"  Margin="20,0,0,0"></TextBlock>
                        <TextBlock Text="{Binding SUM1, Converter={StaticResource d1000}}" Foreground="Red" Margin="20,0,0,0"></TextBlock>
                        <TextBlock Text="{Binding Source={Localization:Translate Word=米}}"  Margin="20,0,0,0"></TextBlock>
                        <TextBlock Text="{Binding Source={Localization:Translate Word=总卷数:}}"  Margin="20,0,0,0"></TextBlock>
                        <TextBlock Text="{Binding Counts}" Foreground="Red" Margin="20,0,0,0"></TextBlock>
                    </WrapPanel>
                </Grid>

            </Expander>
            <StackPanel Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3">
                <WrapPanel Visibility="{Binding IsMaster,ElementName=TV,Converter={StaticResource bv}}">
                    <TextBlock Text="品种:"/>
                    <ex:TXT72 Text="{Binding ART,Converter={StaticResource gb2312},ElementName=TV}" Width="150"/>
                    <TextBlock Text="布卷号:"/>
                    <ex:NumericBox Text="{Binding VAR,ElementName=TV}" MaxLength="12" Width="100"/>
                    <TextBlock Text="{Binding WBBRWLFD}" Width="Auto"/>
                    <TextBlock Text="{Binding WBBPOS}"  Width="Auto"/> 
                
                    <TextBlock Text="{Binding WBBSTKNRK}"  Width="Auto"/>
                    <Button   Click="QueryCommand"    Margin="10,0,0,0" Height="30" Width="30"   VerticalAlignment="Center" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Search.png" />
                        </Button.Background>
                    </Button>
                    <Button   Click="FlipFlopCommand"    Margin="10,0,0,0" Height="30" Width="30"  Content="折叠" />
                    <Label Content="{Binding Source={Localization:Translate Word=开始时间}}"></Label>
                    <TextBox Name="txtSTART" Width="70" MaxLength="8" ></TextBox>
                    <TextBox Name="txtSTART1" Width="40" MaxLength="4"></TextBox>
                    <Label Content="{Binding Source={Localization:Translate Word=结束时间}}"></Label>
                    <TextBox Name="txtEND" Width="70" MaxLength="8"></TextBox>
                    <TextBox Name="txtEND1" Width="40" MaxLength="4" ></TextBox>
                    <Button Name="btnSure" Width="auto" Click="btnSure_Click" >
                        <Grid>
                            <CheckBox Name="checkSure" Content="{Binding Source={Localization:Translate Word=勾选按时间查询}}" IsEnabled="False" IsChecked="False"/>
                        </Grid>

                    </Button>
                    <Button Name="btnDelete" Margin="30,0,0,0" Click="btnDelete_Click" Content="{Binding Source={Localization:Translate Word=删除布卷}}" Foreground="Red"/>
                    <Button   Click="LogOnAdminCommand" Content="{Binding Source={Localization:Translate Word=管理员}}"/>
                </WrapPanel>
                <FK:TWB18  Grid.Row="1" Name="cRK" Visibility="Collapsed"
                       DES="{Binding RWAUF,ElementName=TV}"
                       IsAuto="False"
                        />
                    <FK:TWB18    Grid.Row="4"   Grid.Column="0"  Name="cFK"
                              Visibility="Collapsed"
                              EXAUF="{Binding FRWAUF,ElementName=TV}"
                              IsAuto="False"
                              IsEdit="{Binding IsEdit,ElementName=TV}"
                              IsSaved="{Binding IsSaved,ElementName=TV}"
                              ERVER="{Binding ERVER,ElementName=TV}"/>
                    <me:TFWB08 Grid.Row="0"   Grid.Column="1" 
                             PRNLB="{Binding PRNLB,ElementName=TV}"  
                              ORDERNUM="{Binding KEY,ElementName=TV}"   
                                    IsEdit="{Binding IsEdit,ElementName=TV}" 
                                     IsPrint="{Binding IsPrint,ElementName=TV}"  
                                    IsDBChg="{Binding IsDBChg,ElementName=TV}"  
                                   RWAUF="{Binding FRWAUF,ElementName=TV}" />
                 
                <HR:THR20RT  MachineName="{Binding LOOMID,ElementName=TV}"
                                 KEY="{Binding SHIFTPRODUCTION,ElementName=pbWB19DC}"
                                 />
                <TextBlock Text="{Binding Source={Localization:Translate Word=此界面，更改产量后，必需点击保存按钮}}"/>
            </StackPanel>
            <TabControl Grid.Row="2" Grid.RowSpan="2"  Grid.Column="3" >
                <TabItem  Header="产量">
                    <ER:TWB19DC  Name="pbWB19DC"
                                  IsEdit="True" 
                                 IsKEY="False"
                                 DES="{Binding KEY,ElementName=cRK}"
                                FWB08KEY="{Binding KEY,ElementName=cFK}" 
                     />
                </TabItem>
                <TabItem  Header="花型" Visibility="{Binding IsUBT,ElementName=TV,Converter={StaticResource bv}}">
                    <ER:TWB19PTN   
                                  IsEdit="True"  
                               
                                 DES="{Binding KEY,ElementName=cRK}"
                                FWB08KEY="{Binding KEY,ElementName=cFK}" 
                     />
                </TabItem>
            </TabControl>      
            <ER:TFWB19X Grid.Row="2"   Grid.Column="0"  Grid.ColumnSpan="2"
                    Name="cFERK"
                    IsAuto="False"
                    IsCanNew="False"
                    IsEdit="{Binding IsEdit,ElementName=cFK}"
                    EXAUF="{Binding KEY,ElementName=cFK}"                                    
                    DFFSCHL="{Binding DFFSCHL,ElementName=cFK}" />
            <ex:TPage  Grid.Row="4"  Grid.Column="0"
                   Visibility="{Binding IsPage,Converter={StaticResource bv}}"/>
        </Grid>
    </Grid>
    
</me:UIWBBST>
